home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-25 | 1.2 KB | 26 lines | [TEXT/MPS ] |
- # John,
- # We put this variable initialization in the MacApp startup file, which gets executed at
- # MPW Startup time. Then people can use how they like.
-
- # {MACPlusFormat} - Format string for CDent, the C++ code formatter.
- SET MACPlusFormat ∂
- '-ll 512 -decl0 "&n dl0" ∂
- -fundef4 "• &n" -fundef8 "i+®0 s • &n" -fundef10 "?n∂{• s#}∂{•/?n∂{s#}∂{&n c®2}}" -fundef13 "&n c®2-®0 • n" -fundef14 "&n c®2-®0 • n" ∂
- -if4 "&n • &n i+®0" -if6 "&n c®2-®0 &n • &n" -else3 "&n • &n • i+®0" ∂
- -struct3 "&n• n# i+®0" ∂
- -switch2 "&n • n# i+®0 i+®0" -switch3 "&n c®2-®0 • &s" -switch7 "i-®0 c®2-®0 &n • n#" ∂
- -while2 "&n • n# i+®0" ∂
- -for5 "&n • n# i+®0" ∂
- -do2 "&n • n# i+®0"'
- EXPORT MACPlusFormat
-
-
- # Additionally, on our team we put cdent on a command key using the following bit of script.
- # We can then format an entire open window or a "proper" selection. i.e. a whole function,
- # or other outer level declaration.
-
- # Set up a menu item/command key that will format C++ code, according to MacApp conventions.
-
- AddMenu edit 'CDent §/=' '(CDent {MACPlusFormat} ∂
- <"{active}.§" >"{MPW}cdentText" ≥ "{MPW}MPW.Errors" && catenate "{MPW}cdentText">"{active}.§") || alert <"{MPW}MPW.Errors"'
-